<template>
  <view class="exchange-result fade-in">
    <view class="logo-success" v-if="result == 'success'"></view>
    <view class="logo-fail" v-else></view>
    <view class="text">{{
      result == "success" ? "兑换成功" : resultContent
    }}</view>
  </view>
</template>

<script>
export default {
  props: {
    result: {
      type: String,
      default: "success",
    },
    resultContent: {
      type: String,
      default: "兑换失败",
    },
  },
  data() {
    return {};
  },
  created() {},
};
</script>

<style lang="scss" scoped>
@font-face {
  font-family: "D-DIN-PRO-700-Bold";
  /*定义字体名称*/
  src: url("https://img3.job1001.com/ypMp/elan/images/career/positionDictionary/D-DIN-PRO-700-Bold.ttf");
}

$img-base-person: $img-base + "careerPath/";

.exchange-result {
  width: 400rpx;
  height: 400rpx;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(151, 151, 151, 0.5);
  border-radius: 28rpx;
  padding: 56rpx 90rpx;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  position: fixed;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  z-index: 99;

  .logo-success,
  .logo-fail {
    width: 220rpx;
    height: 220rpx;
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }

  .logo-success {
    background-image: url($img-base + "careerPath/zhituPaySuccessIcon_new.png");
  }

  .logo-fail {
    background-image: url($img-base + "careerPath/zhituPayFailIcon_new.png");
  }

  .text {
    height: 40rpx;
    font-size: 32rpx;
    color: #ffffff;
    line-height: 40rpx;
    font-family: D-DIN-PRO-700-Bold;
  }
}
@keyframes fadeIn {
  from {
    width: 0;
    height: 0;
    opacity: 0;
  }
  to {
    width: 400rpx;
    height: 400rpx;
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}
</style>
